<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>  
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>合同方案列表</title>
<jsp:include page="../../import.jsp" flush="true" />
<style>
	.tab{
		width:80%;
		border:1px solid rgba(228,228,228,1);
		text-align:center;
		margin-left:40px;
	}

	table td{
		border:1px solid rgba(228,228,228,1);
		height:36px;
		text-align:left;
	}
	.td_l{
		text-align:left;
	}
	.td_r{
		text-align:right;
	}
</style>
</head>
<body class="iframeBody">
<div class="Wrapper">
	<table>
		<tr>
			<td>融资合同（资方与承租人）：</td>
			<td><input type="text" id="zlzfb_m4v"></td>
		</tr>
		<tr>
			<td rowspan="4">留购价：</td>
			<td><input name="zlzfb_m7" type="radio" checked value="2"/>留购价</td>
		</tr>
		<tr>
			<td><input name="zlzfb_m7"  type="radio" value="1"/>尾款</td>
		</tr>
		<tr>
			<td><input name="zlzfb_m7" type="radio" value="3"/>默认0</td>
		</tr>
	</table>
	<div class="btnsBox">
		<span id="addBtn"  class="sq-button sq-button-round" onclick="save()">保存</span>
		<span id="cacelBtn"  class="sq-button sq-button-round" onclick="closeDialog()">取消</span>
	</div>
</div>



<script type="text/javascript">

	var dialog = window.frameElement.dialog;
	var callback = dialog.get('data').callback;
	var contCd = dialog.get('data').contCd;

    $(function () {
    	var contKv = dialog.get('data').contKv;
    	if(contKv){
    		showRuleCfg(contKv);
    	}
    	var mode = dialog.get('data').mode;
    	if("show"==mode){
    		$("#addBtn").hide();
    	}
    });


	//m4:xx;m7:xx
	function save() {

		var zlzfb_m4v = $("#zlzfb_m4v").val();
		var v= "m4:"+zlzfb_m4v+";";
		var zlzfb_m7 = $("input[name='zlzfb_m7']:checked").val();
		v = v+"m7:"+zlzfb_m7;
		if(callback){
			callback(v);
		}
		dialog.close();
	}

	function showRuleCfg(contKv){
		var groupArr = contKv.split(";");
		for(var i=0;i<groupArr.length;i++){
			var group = groupArr[i];
			var groupkV = group.split(":");
			if("m4"==groupkV[0]){
				$("#zlzfb_m4v").val(groupkV[1]);
			}else if("m7"==groupkV[0]){
				//$("input[name='']").val(groupkV[1]);
				$("input[name='zlzfb_m7'][value="+groupkV[1]+"]").attr("checked",true)
			}
		}
	}

	function closeDialog() {
		dialog.close();
	}
    

</script>

</body>
</html>